import 'dart:convert';

import 'package:flutter_deer/generated/json/base/json_field.dart';
import 'package:flutter_deer/generated/json/pay_result_entity.g.dart';

export 'package:flutter_deer/generated/json/pay_result_entity.g.dart';

@JsonSerializable()
class PayResultEntity {
	bool? ablePay = false;
	String? disablePayMsg = '';
	String? mchCode = '';
	String? orderAmount = '';
	String? orderCode = '';
	int? orderConfigTime = 0;
	int? orderId = 0;
	int? orderStatus = 0;
	String? orderTime = '';
	int? paidAmount = 0;
	List<PayResultPayResponse>? payResponse = [];
	PayResultPayResult? payResult;
	String? tradeNo = '';

	PayResultEntity();

	factory PayResultEntity.fromJson(Map<String, dynamic> json) => $PayResultEntityFromJson(json);

	Map<String, dynamic> toJson() => $PayResultEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PayResultPayResponse {
	String? failReason = '';
	String? finishTime = '';
	int? orderFinanceId = 0;
	int? orderId = 0;
	String? payCode = '';
	String? payMethod = '';
	String? payMsg = '';
	int? payStatus = 0;
	String? payTime = '';
	String? payType = '';
	String? prePayTn = '';
	bool? success = false;

	PayResultPayResponse();

	factory PayResultPayResponse.fromJson(Map<String, dynamic> json) => $PayResultPayResponseFromJson(json);

	Map<String, dynamic> toJson() => $PayResultPayResponseToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class PayResultPayResult {
	String? failReason = '';
	String? finishTime = '';
	String? orderFinanceId = '';
	String? orderId = '';
	String? payCode = '';
	String? payMethod = '';
	String? payMsg = '';
	int? payStatus = 0;
	String? payTime = '';
	String? payType = '';
	String? prePayTn = '';
	bool? success = false;

	PayResultPayResult();

	factory PayResultPayResult.fromJson(Map<String, dynamic> json) => $PayResultPayResultFromJson(json);

	Map<String, dynamic> toJson() => $PayResultPayResultToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}